import repository from '../repository'
class DeliveryService {
  async getDeliveryList () {
    const data = await repository.getDeliveryList()
   
    return data.data
  }

  async addDelivery (params) {
    const data = await repository.addDelivery(params)
    console.log(data)
    if(data.code!=200){
      throw new Error(data.msg)
    }
    return data.data
  }

  async updateDelivery (params) {
    const data = await repository.updateDelivery(params)
    
    return true
  }

  async deleteDelivery (deliveryId) {
    const data = await repository.deleteDelivery(deliveryId)
   
    return true
  }
}
export default new DeliveryService()
